var request = function(url,params,callback){

    $.ajax({
        url:url,
        type:'POST',
        data:params.data,
        crossDomain:true,
        async:true,
        dataType:'json',
        success:function(res){
            console.log(res)
            return typeof callback == 'function' && callback(res)
        },
        error:function(res){
            return typeof callback == 'function' && callback(false)
        }
    })
}

module.exports = {
    request
}